package com.engine.qz.controller;

import com.engine.common.util.ParamUtil;
import com.engine.common.util.ServiceUtil;
import com.engine.qz.service.KqDevService;
import com.engine.qz.service.impl.KqDevServiceImpl;
import com.google.gson.Gson;
import weaver.hrm.HrmUserVarify;
import weaver.hrm.User;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import java.util.Map;

/**
 * @version 1.0
 * @Title ecology-9
 * @Company 泛微软件
 * @CreateDate 2024/8/12
 * @Description
 * @Author AdminZm
 */
public class KqDevController {

    public KqDevService getKqDevService(User user) {
        return ServiceUtil.getService(KqDevServiceImpl.class,user);
    }

    @POST
    @Path("/updateCqInfo")
    @Produces(MediaType.APPLICATION_JSON)
    public String updateCqInfo(@Context HttpServletRequest request, @Context HttpServletResponse response) {
        User user = HrmUserVarify.getUser(request, response);
        Map<String, Object> params = ParamUtil.request2Map(request);
        Map<String, Object> resultDatas = getKqDevService(user).updateCqInfo(params);
        return  new Gson().toJson(resultDatas);
    }
}
